import React from 'react';
import classnames from 'classnames'

// let importAll = (requireContext: __WebpackModuleApi.RequireContext) => requireContext.keys().forEach(requireContext);
// try {importAll(require.context('icons', true, /\.svg$/));} catch (error) {console.log(error);}

type Props = {
  name?: string
}& React.HTMLAttributes<HTMLElement>

const Icon = (props: Props) => {
  const {name,children,className,...rest}=props
  return (
    // <svg className="icon">
    //   <use xlinkHref={'/#' + props.name}/>
    // </svg>
    <i className={classnames('iconfont',name,className)} {...rest}/>
  );
};


export default Icon;
